import { SET_APP_STATE, ON_TAB_SELECT, FETCH_APP_DATA, GET_SHOWCASE_DATA } from '../../constants/ActionType';

export default function appData(state = {}, action) {
    const { type, payload } = action;
    switch (type) {
        case SET_APP_STATE:
            return { ...state, ...payload };
        case ON_TAB_SELECT:
            return { ...state, selectTab: payload.key };
        case FETCH_APP_DATA:
            return state;
        case GET_SHOWCASE_DATA:
            return {...state, showcaseData: payload};
        default:
            return state;
    }
}